  <#macro action item>
  <#if item.properties['symbol']=='=='>
    condition: "entity.containsKey('${item.properties.column}')&&!(entity.get('${item.properties.column}')==${item.properties.data})"
    actions:
      - "result.put('data',result.getOrDefault('data','')+'${item.properties.errormsg!''}')"
  <#elseif item.properties['symbol']=='!='>
    condition: "entity.containsKey('${item.properties.column}')&&!(entity.get('${item.properties.column}')!=${item.properties.data})"
    actions:
      - "result.put('data',result.getOrDefault('data','')+'${item.properties.errormsg!''}')"
  <#elseif item.properties['symbol']=='>'>
    condition: "entity.containsKey('${item.properties.column}')&&!(entity.get('${item.properties.column}')>${item.properties.data})"
    actions:
      - "result.put('data',result.getOrDefault('data','')+'${item.properties.errormsg!''}')"
  <#elseif item.properties['symbol']=='<'>
    condition: "entity.containsKey('${item.properties.column}')&&!(entity.get('${item.properties.column}')<${item.properties.data})"
    actions:
      - "result.put('data',result.getOrDefault('data','')+'${item.properties.errormsg!''}')"
  <#elseif item.properties['symbol']=='contain'>
    condition: "entity.containsKey('${item.properties.column}')&&!(entity.get('${item.properties.column}').contains('${item.properties.data}'))"
    actions:
      - "result.put('data',result.getOrDefault('data','')+'${item.properties.errormsg!''}')"
  <#elseif item.properties['symbol']=='no_contain'>
    condition: "entity.containsKey('${item.properties.column}')&&!(!entity.get('${item.properties.column}').contains('${item.properties.data}'))"
    actions:
      - "result.put('data',result.getOrDefault('data','')+'${item.properties.errormsg!''}')"
  <#elseif item.properties['symbol']=='startwidth'>
    condition: "entity.containsKey('${item.properties.column}')&&!(entity.get('${item.properties.column}').startsWith('${item.properties.data}'))"
    actions:
      - "result.put('data',result.getOrDefault('data','')+'${item.properties.errormsg!''}')"
  <#elseif item.properties['symbol']=='nostartwidth'>
    condition: "entity.containsKey('${item.properties.column}')&&!(!entity.get('${item.properties.column}').startsWith('${item.properties.data}'))"
    actions:
      - "result.put('data',result.getOrDefault('data','')+'${item.properties.errormsg!''}')"
  <#elseif item.properties['symbol']=='endwidth'>
    condition: "entity.containsKey('${item.properties.column}')&&!(entity.get('${item.properties.column}').endsWith('${item.properties.data}'))"
    actions:
      - "result.put('data',result.getOrDefault('data','')+'${item.properties.errormsg!''}')"
  <#elseif item.properties['symbol']=='noendwidth'>
    condition: "entity.containsKey('${item.properties.column}')&&!(!entity.get('${item.properties.column}').endsWith('${item.properties.data}'))"
    actions:
      - "result.put('data',result.getOrDefault('data','')+'${item.properties.errormsg!''}')"
  <#elseif item.properties['symbol']=='maxlength'>
    condition: "entity.containsKey('${item.properties.column}')&&!(entity.get('${item.properties.column}').toString().length()<='${item.properties.data}')"
    actions:
      - "result.put('data',result.getOrDefault('data','')+'${item.properties.errormsg!''}')"
  <#elseif item.properties['symbol']=='minlength'>
    condition: "entity.containsKey('${item.properties.column}')&&!(entity.get('${item.properties.column}').toString().length()>='${item.properties.data}')"
    actions:
      - "result.put('data',result.getOrDefault('data','')+'${item.properties.errormsg!''}')"
  <#elseif item.properties['symbol']=='regin'>
    condition: "entity.containsKey('${item.properties.column}')&&!(entity.get('${item.properties.column}')~='${item.properties.data}')"
    actions:
      - "result.put('data',result.getOrDefault('data','')+'${item.properties.errormsg!''}')"
  <#elseif item.properties['symbol']=='noNull'>
    condition: "entity.containsKey('${item.properties.column}')&&!(entity.get('${item.properties.column}')!=null)"
    actions:
      - "result.put('data',result.getOrDefault('data','')+'${item.properties.errormsg!''}')"
  <#elseif item.properties['symbol']=='isNull'>
    condition: "entity.containsKey('${item.properties.column}')&&!(entity.get('${item.properties.column}')==null)"
    actions:
      - "result.put('data',result.getOrDefault('data','')+'${item.properties.errormsg!''}')"
  </#if>
  </#macro>
 <#macro conditionmacro item>
<#list item.childrens as condition>
<#if condition.type!='circle'>
  <#if condition.type=='rect'>
  - name : ${item.id}
  <#else>
  - name : ${condition.properties.column}${item.id}
  </#if>
    priority: #{condition_index+1}
  <#if condition.type=='rect'>
    <#if condition.properties.op=='and'>
    compositeRuleType: ActivationRuleGroup
    <#else>
    compositeRuleType: UnitRuleGroup
    </#if>
    composingRules:
  <#else>
       <@action item=condition />
  </#if>
  <#if condition.childrens??>
      <@format blank=4><@conditionmacro item=condition /></@format>
  </#if>
</#if>
</#list>
 </#macro>
